﻿@model AnchorFinder.Models.UrlIncludedModel
@using AnchorFinder.Models
@{
    ViewBag.Title = "ViewResultUrlList";
    Layout = "~/Views/Shared/_Layout.cshtml";

    var Model = (Dictionary<string, List<LinkViewModel>>)ViewBag.UrlListResult;
}

<script type="text/javascript">
    $(function () {
        $('.eventer').click(function () {
            $(this).next().toggle();
        });
        $('.eventer').click();
    });

</script>
<h2>Result</h2>
@foreach (string key in Model.Keys)
{   <div class="wrapper">
        <h3 class="eventer">@key</h3>
        <ul>
        @foreach (LinkViewModel value in (List<LinkViewModel>)Model[key])
        {
            switch (value.LinkTypes)
            {
                case LinkTypes.ImageLink:

                     <text>
                        <li><a href = "@value.LinkHref"><img style="width:30px; height:30px " alt="" src = "@value.SourceForImage"/></a></li>
                     </text>
                     
                                                                                                       break;
                case LinkTypes.TextLink: 
                     <text>
                        <li><a href = "@value.LinkHref">@value.InnerText</a></li>
                     </text>  
                                                   break;
                case LinkTypes.NotFullUrl: 
                     <text>
                        <li>@value.InnerText</li>                      
                     </text> 
                       break;
            }

        }
        </ul>
     </div>
}


<div>
    @Html.ActionLink("Enter another url", "ShowUrl")
</div>
